Skip to content

test(engine): add ffprobe-unavailable fallback regression tests#379

Merged
vanceingalls merged 1 commit intomainfrom
vance/ffprobe-fallback-tests
Apr 23, 2026
Merged

test(engine): add ffprobe-unavailable fallback regression tests#379
vanceingalls merged 1 commit intomainfrom
vance/ffprobe-fallback-tests

Conversation

@vanceingalls
Copy link
Copy Markdown
Collaborator

@vanceingalls vanceingalls commented Apr 21, 2026

Summary

Mock node:child_process.spawn to surface ENOENT and verify ffprobe's three callers behave correctly when ffprobe is missing.

Why

Chunk 9B of plans/hdr-followups.md. The PNG cICP fallback in extractMediaMetadata was added to support environments without ffprobe, but no test pinned the behavior — silently regressing it would break HDR image support on any system without ffprobe installed.

What changed

packages/engine/src/utils/ffprobe.test.ts: mocks child_process.spawn to surface ENOENT and asserts:

  • extractMediaMetadata falls back to PNG cICP metadata for image inputs.
  • extractMediaMetadata rethrows for non-image inputs lacking a still-image fallback.
  • extractAudioMetadata + analyzeKeyframeIntervals propagate the install-hint error verbatim.

Test plan

  • All new tests pass.
  • No production code changes — pure regression coverage of existing fallback behavior.

Stack

Chunk 9B of plans/hdr-followups.md. Test-only change, independent of all other chunks.

Copy link
Copy Markdown
Collaborator Author

vanceingalls commented Apr 21, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from 0294c06 to cc0422f Compare April 21, 2026 20:48
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from 2163cd0 to ca9c359 Compare April 21, 2026 20:54
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from cc0422f to 8638446 Compare April 21, 2026 20:54
@vanceingalls vanceingalls marked this pull request as ready for review April 21, 2026 20:57
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from ca9c359 to d8c43e8 Compare April 21, 2026 22:37
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch 2 times, most recently from dad30f7 to b3cd341 Compare April 22, 2026 01:16
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from 1733e38 to 6881964 Compare April 22, 2026 02:03
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from b3cd341 to 25fb68e Compare April 22, 2026 02:03
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from 1655176 to 16e2fa4 Compare April 23, 2026 03:19
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from 72f4d29 to 2196dec Compare April 23, 2026 03:20
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from 16e2fa4 to 58f97e9 Compare April 23, 2026 03:41
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from 2196dec to 2c19da9 Compare April 23, 2026 03:42
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from 58f97e9 to ea05258 Compare April 23, 2026 04:49
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from 2c19da9 to 40e2154 Compare April 23, 2026 04:50
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from ea05258 to b4fa284 Compare April 23, 2026 05:09
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from 40e2154 to efe5bcb Compare April 23, 2026 05:10
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from b4fa284 to 193ed00 Compare April 23, 2026 05:44
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch 2 times, most recently from 633de87 to ef05bfc Compare April 23, 2026 06:07
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch 2 times, most recently from ff0f25b to e24208f Compare April 23, 2026 06:57
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch 2 times, most recently from 1b05a9e to 4c7b80a Compare April 23, 2026 15:33
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch 2 times, most recently from 2f4a04b to cd80985 Compare April 23, 2026 16:32
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch 2 times, most recently from 5512a6a to c0836ce Compare April 23, 2026 16:35
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch 3 times, most recently from 66d4398 to 7b9eb89 Compare April 23, 2026 17:38
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from c0836ce to f82f2cb Compare April 23, 2026 17:38
@vanceingalls vanceingalls changed the base branch from vance/shader-midpoint-tests to graphite-base/379 April 23, 2026 18:11
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from f82f2cb to 3aca369 Compare April 23, 2026 18:11
@graphite-app graphite-app Bot changed the base branch from graphite-base/379 to main April 23, 2026 18:12
Mock node:child_process.spawn to surface ENOENT and verify that:
- extractMediaMetadata falls back to PNG cICP metadata for image inputs
- extractMediaMetadata rethrows for non-image inputs lacking a still-image fallback
- extractAudioMetadata + analyzeKeyframeIntervals propagate the install-hint error verbatim

Closed gap from hdr-followups Chunk 9B.
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from 3aca369 to f5be292 Compare April 23, 2026 18:12
Copy link
Copy Markdown
Collaborator Author

Merge activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants